import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.fisco.bcos.sdk.v3.client.Client;
import org.fisco.bcos.sdk.v3.codec.datatypes.Address;
import org.fisco.bcos.sdk.v3.codec.datatypes.Bool;
import org.fisco.bcos.sdk.v3.codec.datatypes.Event;
import org.fisco.bcos.sdk.v3.codec.datatypes.Function;
import org.fisco.bcos.sdk.v3.codec.datatypes.Type;
import org.fisco.bcos.sdk.v3.codec.datatypes.TypeReference;
import org.fisco.bcos.sdk.v3.codec.datatypes.Utf8String;
import org.fisco.bcos.sdk.v3.codec.datatypes.generated.Bytes32;
import org.fisco.bcos.sdk.v3.codec.datatypes.generated.Uint256;
import org.fisco.bcos.sdk.v3.codec.datatypes.generated.Uint8;
import org.fisco.bcos.sdk.v3.codec.datatypes.generated.tuples.generated.Tuple1;
import org.fisco.bcos.sdk.v3.codec.datatypes.generated.tuples.generated.Tuple2;
import org.fisco.bcos.sdk.v3.codec.datatypes.generated.tuples.generated.Tuple3;
import org.fisco.bcos.sdk.v3.codec.datatypes.generated.tuples.generated.Tuple4;
import org.fisco.bcos.sdk.v3.codec.datatypes.generated.tuples.generated.Tuple9;
import org.fisco.bcos.sdk.v3.contract.Contract;
import org.fisco.bcos.sdk.v3.crypto.CryptoSuite;
import org.fisco.bcos.sdk.v3.crypto.keypair.CryptoKeyPair;
import org.fisco.bcos.sdk.v3.model.CryptoType;
import org.fisco.bcos.sdk.v3.model.TransactionReceipt;
import org.fisco.bcos.sdk.v3.model.callback.TransactionCallback;
import org.fisco.bcos.sdk.v3.transaction.manager.TransactionProcessor;
import org.fisco.bcos.sdk.v3.transaction.manager.transactionv1.TransactionManager;
import org.fisco.bcos.sdk.v3.transaction.model.exception.ContractException;

@SuppressWarnings("unchecked")
public class BTSIBID extends Contract {
    public static final String[] BINARY_ARRAY = {"60806040523480156200001157600080fd5b506200001f60003362000025565b620000c6565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620000c2576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620000813390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b612bb480620000d66000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c806391d1485411610097578063b7d2e7f611610066578063b7d2e7f614610225578063d547741f14610238578063e2baea301461024b578063f198518b1461027357600080fd5b806391d14854146101d4578063a217fddf146101e7578063aa586468146101ef578063b4ac2f801461021257600080fd5b806336568abe116100d357806336568abe1461018857806348e2ed9a1461019b578063695711ac146101ae57806370c187ca146101c157600080fd5b806301ffc9a714610105578063248a9ca31461012d5780632cdb52d11461015e5780632f2ff15d14610173575b600080fd5b610118610113366004612365565b610286565b60405190151581526020015b60405180910390f35b61015061013b36600461238f565b60009081526020819052604090206001015490565b604051908152602001610124565b610150600080516020612b5f83398151915281565b6101866101813660046123a8565b6102bd565b005b6101866101963660046123a8565b6102e7565b6101866101a936600461242d565b61036a565b6101866101bc36600461246f565b61042a565b6101866101cf3660046124bb565b610801565b6101186101e23660046123a8565b61086d565b610150600081565b6102026101fd36600461242d565b610896565b60405161012494939291906125b1565b6101866102203660046125f6565b610c17565b610186610233366004612662565b610dbe565b6101866102463660046123a8565b6111a9565b61025e61025936600461242d565b6111ce565b6040516101249998979695949392919061272a565b6101866102813660046127d9565b6115e4565b60006001600160e01b03198216637965db0b60e01b14806102b757506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000828152602081905260409020600101546102d8816117a1565b6102e283836117ae565b505050565b6001600160a01b038116331461035c5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6103668282611832565b5050565b6000610375816117a1565b600060018484604051610389929190612853565b908152604051908190036020019020546001600160a01b03169050806103c15760405162461bcd60e51b815260040161035390612863565b6103d9600080516020612b5f833981519152826111a9565b83836040516103e9929190612853565b604051908190038120906001600160a01b038316907f1a92e6067a8d8b4f02582df4a2e6ff7749c5107b98a702338e6cfb70d7081ee790600090a350505050565b6000610435816117a1565b600060018585604051610449929190612853565b908152604051908190036020019020546001600160a01b03169050806104815760405162461bcd60e51b815260040161035390612863565b6001600160a01b03808216600090815260046020818152604080842081516101008101835281548152600182015460ff1615159381019390935260028101549183019190915260038101548516606083015291820154909316608084015260058101805492939260a0840191906104f79061288f565b80601f01602080910402602001604051908101604052809291908181526020018280546105239061288f565b80156105705780601f1061054557610100808354040283529160200191610570565b820191906000526020600020905b81548152906001019060200180831161055357829003601f168201915b5050509183525050600682015460208083019190915260079092015460409182015282516000908152600390925280822081516060810190925280549394509192909190829060ff1660018111156105ca576105ca612714565b60018111156105db576105db612714565b81526020016001820180546105ef9061288f565b80601f016020809104026020016040519081016040528092919081815260200182805461061b9061288f565b80156106685780601f1061063d57610100808354040283529160200191610668565b820191906000526020600020905b81548152906001019060200180831161064b57829003601f168201915b505050505081526020016002820180546106819061288f565b80601f01602080910402602001604051908101604052809291908181526020018280546106ad9061288f565b80156106fa5780601f106106cf576101008083540402835291602001916106fa565b820191906000526020600020905b8154815290600101906020018083116106dd57829003601f168201915b505050505081525050905060018081111561071757610717612714565b8151600181111561072a5761072a612714565b146107775760405162461bcd60e51b815260206004820152601a60248201527f706572736f6e616c206964656e746974792070726f76696465640000000000006044820152606401610353565b61078f600080516020612b5f833981519152846102bd565b6001600160a01b03831660009081526004602052604090819020600701869055516107bd9088908890612853565b604051908190038120906001600160a01b038516907f2fb3e571a13893899d82d9aacf9d0e3af0069a399d44eb923820d94ba335402490600090a350505050505050565b6108118686868686866001610dbe565b8585604051610821929190612853565b60405180910390206108303390565b6001600160a01b03167f509d1fc5d868e50221c36da0af312cc0315de10af9e9500b1d8cc3954661a29c60405160405180910390a3505050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000606080600080600187876040516108b0929190612853565b908152604051908190036020019020546001600160a01b03169050806109085760405162461bcd60e51b815260206004820152600d60248201526c189a59081b9bdd08199bdd5b99609a1b6044820152606401610353565b610920600080516020612b5f8339815191528261086d565b61095a5760405162461bcd60e51b815260206004820152600b60248201526a0626964206e6f74206964760ac1b6044820152606401610353565b6001600160a01b03808216600090815260046020818152604080842081516101008101835281548152600182015460ff1615159381019390935260028101549183019190915260038101548516606083015291820154909316608084015260058101805492939260a0840191906109d09061288f565b80601f01602080910402602001604051908101604052809291908181526020018280546109fc9061288f565b8015610a495780601f10610a1e57610100808354040283529160200191610a49565b820191906000526020600020905b815481529060010190602001808311610a2c57829003601f168201915b5050509183525050600682015460208083019190915260079092015460409182015282516000908152600390925280822081516060810190925280549394509192909190829060ff166001811115610aa357610aa3612714565b6001811115610ab457610ab4612714565b8152602001600182018054610ac89061288f565b80601f0160208091040260200160405190810160405280929190818152602001828054610af49061288f565b8015610b415780601f10610b1657610100808354040283529160200191610b41565b820191906000526020600020905b815481529060010190602001808311610b2457829003601f168201915b50505050508152602001600282018054610b5a9061288f565b80601f0160208091040260200160405190810160405280929190818152602001828054610b869061288f565b8015610bd35780601f10610ba857610100808354040283529160200191610bd3565b820191906000526020600020905b815481529060010190602001808311610bb657829003601f168201915b505050919092525050506001600160a01b0384166000908152600460209081526040918290206007015491830151920151909b919a50985092965091945050505050565b600080516020612b5f833981519152610c2f816117a1565b600060018686604051610c43929190612853565b908152604051908190036020019020546001600160a01b0316905080610c7b5760405162461bcd60e51b815260040161035390612863565b6001600160a01b0381166000908152600460205260409020600181015460ff168015610caa5750428160060154115b610ce55760405162461bcd60e51b815260206004820152600c60248201526b1b9bdd081d995c9a599a595960a21b6044820152606401610353565b60048101546001600160a01b03163314610d305760405162461bcd60e51b815260206004820152600c60248201526b0d2c8e040dad2e6dac2e8c6d60a31b6044820152606401610353565b60018101805460ff19169055610d4a600582018686612258565b506004810180546001600160a01b031916905560006006820155426002820155604051610d7a9088908890612853565b604051908190038120906001600160a01b038416907ff6e6c2bdd02a42d5b91f6e2a950d9e80fd08830a915d0619d81ed8c142a8da8c90600090a350505050505050565b610dc88787611897565b6000610de4826001811115610ddf57610ddf612714565b611b16565b9050610e37610e2887878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611c1c92505050565b610e3183611c1c565b90611c49565b9050610e7b610e2885858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611c1c92505050565b9050600081604051602001610e9091906128ca565b6040516020818303038152906040528051906020012090506000610eb13390565b6001600160a01b038082166000908152600460205260409020600301549192501615610f185760405162461bcd60e51b8152602060048201526016602482015275189a5908185b1c9958591e481c9959da5cdd195c995960521b6044820152606401610353565b6040518060600160405280856001811115","610f3557610f35612714565b815260200189898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505090825250604080516020601f8a018190048102820181019092528881529181019190899089908190840183828082843760009201829052509390945250508481526003602052604090208251815491925090829060ff191660018381811115610fda57610fda612714565b02179055506020828101518051610ff792600185019201906122dc565b50604082015180516110139160028401916020909101906122dc565b50506040805161010081018252848152600060208083018281528385018381526001600160a01b03888116606087018181526080880187815289518088018b5288815260a08a0190815260c08a0189905260e08a0189905292885260048088529990972088518155945160018601805460ff19169115159190911790559251600285015591516003840180546001600160a01b0319908116928416929092179055945196830180549095169616959095179092559251805192945090926110e2926005850192909101906122dc565b5060c0820151816006015560e082015181600701559050508060018b8b60405161110d929190612853565b908152604080516020928190038301902080546001600160a01b0319166001600160a01b039485161790559183166000908152600290915220611151908b8b612258565b508989604051611162929190612853565b604051908190038120906001600160a01b038316907f0b93046e2c99dc347d27b7a82fbc007ac279232963713ad8e4360bfbea878b0390600090a350505050505050505050565b6000828152602081905260409020600101546111c4816117a1565b6102e28383611832565b6000606080600060608060008060008060018c8c6040516111f0929190612853565b908152604051908190036020019020546001600160a01b03169050806112485760405162461bcd60e51b815260206004820152600d60248201526c189a59081b9bdd08199bdd5b99609a1b6044820152606401610353565b6001600160a01b03808216600090815260046020818152604080842081516101008101835281548152600182015460ff1615159381019390935260028101549183019190915260038101548516606083015291820154909316608084015260058101805492939260a0840191906112be9061288f565b80601f01602080910402602001604051908101604052809291908181526020018280546112ea9061288f565b80156113375780601f1061130c57610100808354040283529160200191611337565b820191906000526020600020905b81548152906001019060200180831161131a57829003601f168201915b5050509183525050600682015460208083019190915260079092015460409182015282516000908152600390925280822081516060810190925280549394509192909190829060ff16600181111561139157611391612714565b60018111156113a2576113a2612714565b81526020016001820180546113b69061288f565b80601f01602080910402602001604051908101604052809291908181526020018280546113e29061288f565b801561142f5780601f106114045761010080835404028352916020019161142f565b820191906000526020600020905b81548152906001019060200180831161141257829003601f168201915b505050505081526020016002820180546114489061288f565b80601f01602080910402602001604051908101604052809291908181526020018280546114749061288f565b80156114c15780601f10611496576101008083540402835291602001916114c1565b820191906000526020600020905b8154815290600101906020018083116114a457829003601f168201915b5050505050815250509050816020015194508480156114e35750428260c00151105b156114ed57600094505b806000015181604001518260200151856002600087608001516001600160a01b03166001600160a01b031681526020019081526020016000208660a001518760c001518b89604001518480546115429061288f565b80601f016020809104026020016040519081016040528092919081815260200182805461156e9061288f565b80156115bb5780601f10611590576101008083540402835291602001916115bb565b820191906000526020600020905b81548152906001019060200180831161159e57829003601f168201915b505050505094509b509b509b509b509b509b509b509b509b505050509295985092959850929598565b600080516020612b5f8339815191526115fc816117a1565b600060018787604051611610929190612853565b908152604051908190036020019020546001600160a01b03169050806116485760405162461bcd60e51b815260040161035390612863565b6001600160a01b03811660009081526004602052604090204286116116a65760405162461bcd60e51b81526020600482015260146024820152731d985b1a591a5d1e481a5b881d1a19481c185cdd60621b6044820152606401610353565b600181015460ff1615806116bd5750428160060154105b6116fc5760405162461bcd60e51b815260206004820152601060248201526f185b1c9958591e481d995c9a599a595960821b6044820152606401610353565b6001818101805460ff19169091179055426002820155611720600582018686612258565b506004810180546001600160a01b031916331790556006810186905560405161174c9089908990612853565b6040518091039020826001600160a01b03167f0a67eee75535eefe74229e292cb7e1b1c9a422c4f6c98ab11d439bedcaa9a1458860405161178f91815260200190565b60405180910390a35050505050505050565b6117ab8133611ce1565b50565b6117b8828261086d565b610366576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556117ee3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61183c828261086d565b15610366576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600082828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052506040805180820190915260018152601d60f91b602082015294955092506118f59150849050611c1c565b9050600061190283611c1c565b905061190e8282611d45565b6002146119525760405162461bcd60e51b81526020600482015260126024820152711a5b9d985b1a5908189a5908199bdc9b585d60721b6044820152606401610353565b60006119666119618484611de6565b611e05565b90507fa5f015b989eca923a6a333390acd9649c8fe58560a9c20d6b4e54ee70b5de4f08160405160200161199a91906128ca565b60405160208183030381529060405280519060200120146119f25760405162461bcd60e51b81526020600482015260126024820152711a5b9d985b1a5908189a5908199bdc9b585d60721b6044820152606401610353565b6000611a016119618585611de6565b90506000611a126119618686611de6565b90507f07855b46a623a8ecabac76ed697aa4e13631e3b6718c8a0d342860c13c30d2fc82604051602001611a4691906128ca565b604051602081830303815290604052805190602001201415611b0b5780604051602001611a7391906128ca565b60405160208183030381529060405280519060200120611aa3611a933390565b6001600160a01b03166014611e6e565b604051602001611ab391906128ca565b6040516020818303038152906040528051906020012014611b0b5760405162461bcd60e51b81526020600482015260126024820152710e0eac4d8d2c696caf240dad2e6dac2e8c6d60731b6044820152606401610353565b505050505050505050565b606081611b3a5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611b645780611b4e816128fc565b9150611b5d9050600a8361292d565b9150611b3e565b60008167ffffffffffffffff811115611b7f57611b7f612941565b6040519080825280601f01601f191660200182016040528015611ba9576020820181803683370190505b5090505b8415611c1457611bbe600183612957565b9150611bcb600a8661296e565b611bd6906030612982565b60f81b818381518110611beb57611beb61299a565b60200101906001600160f81b031916908160001a905350611c0d600a8661292d565b9450611bad565b949350505050565b60408051808201825260008082526020918201528151808301909252825182529182019181019190915290565b80518251606091600091611c5d9190612982565b67ffffffffffffffff811115611c7557611c75612941565b6040519080825280601f01601f191660200182016040528015611c9f576020820181803683370190505b5090506000602082019050611cbd8186602001518760000151612011565b8451611cd990611ccd9083612982565b60208601518651612011565b509392505050565b611ceb828261086d565b61036657611d03816001600160a01b03166014611e6e565b611d0e836020611e6e565b604051602001611d1f9291906129b0565b60408051601f198184030181529082905262461bcd60e51b825261035391600401612a25565b6000808260000151611d69856000015186602001518660000151876020015161208b565b611d739190612982565b90505b83516020850151611d879190612982565b8111611ddf5781611d97816128fc565b9250508260000151611dce856020015183611db29190612957565b8651611dbe9190612957565b838660000151876020015161208b565b611dd89190612982565b9050611d76565b5092915050565b6040805180820190915260008082526020820152611ddf8383836121ac565b60606000826000015167ffffffffffffffff811115611e2657611e26612941565b6040519080825280601f01601f191660200182016040528015611e50576020820181803683370190505b5090506000602082019050611ddf8185602001518660000151612011565b60606000611e7d836002612a38565b611e88906002612982565b67ffffffffffffffff811115611ea057611ea0612941565b6040519080825280601f01601f191660200182016040528015611eca576020820181803683370190505b509050600360fc1b81600081518110611ee557611ee561299a565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611f1457611f1461299a565b60200101906001600160f81b031916908160001a90","53506000611f38846002612a38565b611f43906001612982565b90505b6001811115611fbb576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611f7757611f7761299a565b1a60f81b828281518110611f8d57611f8d61299a565b60200101906001600160f81b031916908160001a90535060049490941c93611fb481612a57565b9050611f46565b50831561200a5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610353565b9392505050565b602081106120495781518352612028602084612982565b9250612035602083612982565b9150612042602082612957565b9050612011565b600019811561207857600161205f836020612957565b61206b90610100612b52565b6120759190612957565b90505b9151835183169219169190911790915250565b60008381868511612197576020851161214557600085156120d75760016120b3876020612957565b6120be906008612a38565b6120c9906002612b52565b6120d39190612957565b1990505b845181166000876120e88b8b612982565b6120f29190612957565b855190915083165b8281146121375781861061211f576121128b8b612982565b9650505050505050611c14565b85612129816128fc565b9650508386511690506120fa565b859650505050505050611c14565b508383206000905b6121578689612957565b821161219557858320818114156121745783945050505050611c14565b61217f600185612982565b935050818061218d906128fc565b92505061214d565b505b6121a18787612982565b979650505050505050565b604080518082019091526000808252602082015260006121de856000015186602001518660000151876020015161208b565b6020808701805191860191909152519091506121fa9082612957565b83528451602086015161220d9190612982565b81141561221d576000855261224f565b8351835161222b9190612982565b8551869061223a908390612957565b90525083516122499082612982565b60208601525b50909392505050565b8280546122649061288f565b90600052602060002090601f01602090048101928261228657600085556122cc565b82601f1061229f5782800160ff198235161785556122cc565b828001600101855582156122cc579182015b828111156122cc5782358255916020019190600101906122b1565b506122d8929150612350565b5090565b8280546122e89061288f565b90600052602060002090601f01602090048101928261230a57600085556122cc565b82601f1061232357805160ff19168380011785556122cc565b828001600101855582156122cc579182015b828111156122cc578251825591602001919060010190612335565b5b808211156122d85760008155600101612351565b60006020828403121561237757600080fd5b81356001600160e01b03198116811461200a57600080fd5b6000602082840312156123a157600080fd5b5035919050565b600080604083850312156123bb57600080fd5b8235915060208301356001600160a01b03811681146123d957600080fd5b809150509250929050565b60008083601f8401126123f657600080fd5b50813567ffffffffffffffff81111561240e57600080fd5b60208301915083602082850101111561242657600080fd5b9250929050565b6000806020838503121561244057600080fd5b823567ffffffffffffffff81111561245757600080fd5b612463858286016123e4565b90969095509350505050565b60008060006040848603121561248457600080fd5b833567ffffffffffffffff81111561249b57600080fd5b6124a7868287016123e4565b909790965060209590950135949350505050565b600080600080600080606087890312156124d457600080fd5b863567ffffffffffffffff808211156124ec57600080fd5b6124f88a838b016123e4565b9098509650602089013591508082111561251157600080fd5b61251d8a838b016123e4565b9096509450604089013591508082111561253657600080fd5b5061254389828a016123e4565b979a9699509497509295939492505050565b60005b83811015612570578181015183820152602001612558565b8381111561257f576000848401525b50505050565b6000815180845261259d816020860160208601612555565b601f01601f19169290920160200192915050565b8481526080602082015260006125ca6080830186612585565b82810360408401526125dc8186612585565b91505060018060a01b038316606083015295945050505050565b6000806000806040858703121561260c57600080fd5b843567ffffffffffffffff8082111561262457600080fd5b612630888389016123e4565b9096509450602087013591508082111561264957600080fd5b50612656878288016123e4565b95989497509550505050565b60008060008060008060006080888a03121561267d57600080fd5b873567ffffffffffffffff8082111561269557600080fd5b6126a18b838c016123e4565b909950975060208a01359150808211156126ba57600080fd5b6126c68b838c016123e4565b909750955060408a01359150808211156126df57600080fd5b506126ec8a828b016123e4565b90945092505060608801356002811061270457600080fd5b8091505092959891949750929550565b634e487b7160e01b600052602160045260246000fd5b600061012060028c1061274d57634e487b7160e01b600052602160045260246000fd5b8b83528060208401526127628184018c612585565b90508281036040840152612776818b612585565b6001600160a01b038a166060850152905082810360808401526127998189612585565b905082810360a08401526127ad8188612585565b9150508460c08301526127c460e083018515159052565b826101008301529a9950505050505050505050565b6000806000806000606086880312156127f157600080fd5b853567ffffffffffffffff8082111561280957600080fd5b61281589838a016123e4565b909750955060208801359450604088013591508082111561283557600080fd5b50612842888289016123e4565b969995985093965092949392505050565b8183823760009101908152919050565b602080825260129082015271189a59081b9bdd081c9959da5cdd195c995960721b604082015260600190565b600181811c908216806128a357607f821691505b602082108114156128c457634e487b7160e01b600052602260045260246000fd5b50919050565b600082516128dc818460208701612555565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b6000600019821415612910576129106128e6565b5060010190565b634e487b7160e01b600052601260045260246000fd5b60008261293c5761293c612917565b500490565b634e487b7160e01b600052604160045260246000fd5b600082821015612969576129696128e6565b500390565b60008261297d5761297d612917565b500690565b60008219821115612995576129956128e6565b500190565b634e487b7160e01b600052603260045260246000fd5b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516129e8816017850160208801612555565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612a19816028840160208801612555565b01602801949350505050565b60208152600061200a6020830184612585565b6000816000190483118215151615612a5257612a526128e6565b500290565b600081612a6657612a666128e6565b506000190190565b600181815b80851115612aa9578160001904821115612a8f57612a8f6128e6565b80851615612a9c57918102915b93841c9390800290612a73565b509250929050565b600082612ac0575060016102b7565b81612acd575060006102b7565b8160018114612ae35760028114612aed57612b09565b60019150506102b7565b60ff841115612afe57612afe6128e6565b50506001821b6102b7565b5060208310610133831016604e8410600b8410161715612b2c575081810a6102b7565b612b368383612a6e565b8060001904821115612b4a57612b4a6128e6565b029392505050565b600061200a8383612ab156fe1dbedc701ccaf880a986c8793e63893f8702e22a69ef4756e4f33d2ceddf46c1a26469706673582212206624041b81c3cb0d41731496734660e94c6c9144ca9ab12f95ebcb6a2670515764736f6c634300080b0033"};

    public static final String BINARY = org.fisco.bcos.sdk.v3.utils.StringUtils.joinAll("", BINARY_ARRAY);

    public static final String[] SM_BINARY_ARRAY = {"60806040523480156200001157600080fd5b506200001f60003362000025565b620000c6565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620000c2576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620000813390565b6001600160a01b0316816001600160a01b0316837f3a8c19c5eddb5ca7fdd091f00e2b3978b86344c928af4d2d7f6733572cc06b4c60405160405180910390a45b5050565b612bc380620000d66000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c8063920479ae11610097578063de92755c11610066578063de92755c1461021a578063ea7eb7981461023d578063fbd3f0bf14610250578063fd09e7d61461027357600080fd5b8063920479ae146101be578063954670ab146101e157806399132733146101f4578063db2a269b1461020757600080fd5b80634a9dae03116100d35780634a9dae03146101725780635472010b146101855780636912993d146101985780639079138f146101ab57600080fd5b806317d66dc8146101055780631b3240b81461011a578063370083ed14610135578063431f0e841461015d575b600080fd5b610118610113366004612374565b610286565b005b610122600081565b6040519081526020015b60405180910390f35b6101486101433660046123f9565b61030a565b60405161012c999897969594939291906124ad565b610122600080516020612b6e83398151915281565b6101186101803660046123f9565b610721565b610118610193366004612374565b6107e2565b6101186101a636600461255c565b61080c565b6101186101b936600461260e565b610bf8565b6101d16101cc3660046123f9565b610fd1565b60405161012c949392919061265a565b6101186101ef36600461269f565b611354565b610118610202366004612719565b611514565b610118610215366004612785565b6116be565b61022d610228366004612374565b61172a565b604051901515815260200161012c565b61022d61024b36600461281f565b611755565b61012261025e366004612849565b60009081526020819052604090206001015490565b610118610281366004612374565b61178a565b6001600160a01b03811633146102fc57604051636381e58960e11b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61030682826117ab565b5050565b6000606080600060608060008060008060018c8c60405161032c929190612862565b908152604051908190036020019020546001600160a01b031690508061038557604051636381e58960e11b815260206004820152600d60248201526c189a59081b9bdd08199bdd5b99609a1b60448201526064016102f3565b6001600160a01b03808216600090815260046020818152604080842081516101008101835281548152600182015460ff1615159381019390935260028101549183019190915260038101548516606083015291820154909316608084015260058101805492939260a0840191906103fb90612872565b80601f016020809104026020016040519081016040528092919081815260200182805461042790612872565b80156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b5050509183525050600682015460208083019190915260079092015460409182015282516000908152600390925280822081516060810190925280549394509192909190829060ff1660018111156104ce576104ce61243b565b60018111156104df576104df61243b565b81526020016001820180546104f390612872565b80601f016020809104026020016040519081016040528092919081815260200182805461051f90612872565b801561056c5780601f106105415761010080835404028352916020019161056c565b820191906000526020600020905b81548152906001019060200180831161054f57829003601f168201915b5050505050815260200160028201805461058590612872565b80601f01602080910402602001604051908101604052809291908181526020018280546105b190612872565b80156105fe5780601f106105d3576101008083540402835291602001916105fe565b820191906000526020600020905b8154815290600101906020018083116105e157829003601f168201915b5050505050815250509050816020015194508480156106205750428260c00151105b1561062a57600094505b806000015181604001518260200151856002600087608001516001600160a01b03166001600160a01b031681526020019081526020016000208660a001518760c001518b896040015184805461067f90612872565b80601f01602080910402602001604051908101604052809291908181526020018280546106ab90612872565b80156106f85780601f106106cd576101008083540402835291602001916106f8565b820191906000526020600020905b8154815290600101906020018083116106db57829003601f168201915b505050505094509b509b509b509b509b509b509b509b509b505050509295985092959850929598565b600061072c81611810565b600060018484604051610740929190612862565b908152604051908190036020019020546001600160a01b031690508061077957604051636381e58960e11b81526004016102f3906128ad565b610791600080516020612b6e8339815191528261178a565b83836040516107a1929190612862565b604051908190038120906001600160a01b038316907fbc47f9629bdc0f962e7d4b616c5ee5abd9a7140380eaca74a349faffb639ba5190600090a350505050565b6000828152602081905260409020600101546107fd81611810565b610807838361181d565b505050565b61081687876118a1565b600061083282600181111561082d5761082d61243b565b611b23565b905061088561087687878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611c2992505050565b61087f83611c29565b90611c56565b90506108c961087685858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611c2992505050565b90506000816040516020016108de91906128d9565b60405160208183030381529060405280519060200120905060006108ff3390565b6001600160a01b03808216600090815260046020526040902060030154919250161561096757604051636381e58960e11b8152602060048201526016602482015275189a5908185b1c9958591e481c9959da5cdd195c995960521b60448201526064016102f3565b60405180606001604052808560018111156109845761098461243b565b815260200189898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505090825250604080516020601f8a018190048102820181019092528881529181019190899089908190840183828082843760009201829052509390945250508481526003602052604090208251815491925090829060ff191660018381811115610a2957610a2961243b565b02179055506020828101518051610a469260018501920190612267565b5060408201518051610a62916002840191602090910190612267565b50506040805161010081018252848152600060208083018281528385018381526001600160a01b03888116606087018181526080880187815289518088018b5288815260a08a0190815260c08a0189905260e08a0189905292885260048088529990972088518155945160018601805460ff19169115159190911790559251600285015591516003840180546001600160a01b031990811692841692909217905594519683018054909516961695909517909255925180519294509092610b3192600585019290910190612267565b5060c0820151816006015560e082015181600701559050508060018b8b604051610b5c929190612862565b908152604080516020928190038301902080546001600160a01b0319166001600160a01b039485161790559183166000908152600290915220610ba0908b8b6122eb565b508989604051610bb1929190612862565b604051908190038120906001600160a01b038316907f34db5da6a91f628a1c1719bdc291eca1abfacc50d0746f12648328e470d5b71c90600090a350505050505050505050565b6000610c0381611810565b600060018585604051610c17929190612862565b908152604051908190036020019020546001600160a01b0316905080610c5057604051636381e58960e11b81526004016102f3906128ad565b6001600160a01b03808216600090815260046020818152604080842081516101008101835281548152600182015460ff1615159381019390935260028101549183019190915260038101548516606083015291820154909316608084015260058101805492939260a084019190610cc690612872565b80601f0160208091040260200160405190810160405280929190818152602001828054610cf290612872565b8015610d3f5780601f10610d1457610100808354040283529160200191610d3f565b820191906000526020600020905b815481529060010190602001808311610d2257829003601f168201915b5050509183525050600682015460208083019190915260079092015460409182015282516000908152600390925280822081516060810190925280549394509192909190829060ff166001811115610d9957610d9961243b565b6001811115610daa57610daa61243b565b8152602001600182018054610dbe90612872565b80601f0160208091040260200160405190810160405280929190818152602001828054610dea90612872565b8015610e375780601f10610e0c57610100808354040283529160200191610e37565b820191906000526020600020905b815481529060010190602001808311610e1a57829003601f168201915b50505050508152602001600282018054610e5090612872565b80601f0160208091040260200160405190810160405280929190818152602001828054610e7c90612872565b8015610ec95780601f10610e9e57610100808354040283529160200191610ec9565b820191906000526020600020905b815481529060010190602001808311610eac57829003601f168201915b5050505050815250509050600180811115610ee657610ee661243b565b81516001811115610ef957610ef961243b565b14610f4757604051636381e58960e11b815260206004820152601a60248201527f706572736f6e616c206964656e7469","74792070726f766964656400000000000060448201526064016102f3565b610f5f600080516020612b6e833981519152846107e2565b6001600160a01b0383166000908152600460205260409081902060070186905551610f8d9088908890612862565b604051908190038120906001600160a01b038516907fa82a4b6db356e4cfdef31b533782a3bca22d093333f6ff4bdf0c5bb8a681461e90600090a350505050505050565b600060608060008060018787604051610feb929190612862565b908152604051908190036020019020546001600160a01b031690508061104457604051636381e58960e11b815260206004820152600d60248201526c189a59081b9bdd08199bdd5b99609a1b60448201526064016102f3565b61105c600080516020612b6e8339815191528261172a565b61109757604051636381e58960e11b815260206004820152600b60248201526a0626964206e6f74206964760ac1b60448201526064016102f3565b6001600160a01b03808216600090815260046020818152604080842081516101008101835281548152600182015460ff1615159381019390935260028101549183019190915260038101548516606083015291820154909316608084015260058101805492939260a08401919061110d90612872565b80601f016020809104026020016040519081016040528092919081815260200182805461113990612872565b80156111865780601f1061115b57610100808354040283529160200191611186565b820191906000526020600020905b81548152906001019060200180831161116957829003601f168201915b5050509183525050600682015460208083019190915260079092015460409182015282516000908152600390925280822081516060810190925280549394509192909190829060ff1660018111156111e0576111e061243b565b60018111156111f1576111f161243b565b815260200160018201805461120590612872565b80601f016020809104026020016040519081016040528092919081815260200182805461123190612872565b801561127e5780601f106112535761010080835404028352916020019161127e565b820191906000526020600020905b81548152906001019060200180831161126157829003601f168201915b5050505050815260200160028201805461129790612872565b80601f01602080910402602001604051908101604052809291908181526020018280546112c390612872565b80156113105780601f106112e557610100808354040283529160200191611310565b820191906000526020600020905b8154815290600101906020018083116112f357829003601f168201915b505050919092525050506001600160a01b0384166000908152600460209081526040918290206007015491830151920151909b919a50985092965091945050505050565b600080516020612b6e83398151915261136c81611810565b600060018787604051611380929190612862565b908152604051908190036020019020546001600160a01b03169050806113b957604051636381e58960e11b81526004016102f3906128ad565b6001600160a01b038116600090815260046020526040902042861161141857604051636381e58960e11b81526020600482015260146024820152731d985b1a591a5d1e481a5b881d1a19481c185cdd60621b60448201526064016102f3565b600181015460ff16158061142f5750428160060154105b61146f57604051636381e58960e11b815260206004820152601060248201526f185b1c9958591e481d995c9a599a595960821b60448201526064016102f3565b6001818101805460ff191690911790554260028201556114936005820186866122eb565b506004810180546001600160a01b03191633179055600681018690556040516114bf9089908990612862565b6040518091039020826001600160a01b03167f8ffc7f75141c7a499e9dc580e4bf119db23b7cbb99481a8a2865b73af26613ae8860405161150291815260200190565b60405180910390a35050505050505050565b600080516020612b6e83398151915261152c81611810565b600060018686604051611540929190612862565b908152604051908190036020019020546001600160a01b031690508061157957604051636381e58960e11b81526004016102f3906128ad565b6001600160a01b0381166000908152600460205260409020600181015460ff1680156115a85750428160060154115b6115e457604051636381e58960e11b815260206004820152600c60248201526b1b9bdd081d995c9a599a595960a21b60448201526064016102f3565b60048101546001600160a01b0316331461163057604051636381e58960e11b815260206004820152600c60248201526b0d2c8e040dad2e6dac2e8c6d60a31b60448201526064016102f3565b60018101805460ff1916905561164a6005820186866122eb565b506004810180546001600160a01b03191690556000600682015542600282015560405161167a9088908890612862565b604051908190038120906001600160a01b038416907f877279fd5b8c93b03bf3aba4422403ba40f94765ef98fdf0d79cbbadb108cfbb90600090a350505050505050565b6116ce868686868686600161080c565b85856040516116de929190612862565b60405180910390206116ed3390565b6001600160a01b03167fb3ee1889ab38bc5e05bdece6aa64e30b9e34c6e086c953e9ea159b8d46aaeb2860405160405180910390a3505050505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff165b92915050565b60006001600160e01b03198216634df6077b60e11b148061174f5750631d4fd6f360e31b6001600160e01b031983161461174f565b6000828152602081905260409020600101546117a581611810565b61080783835b6117b5828261172a565b15610306576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917fddf24a0d777ab37f0cd0acf6e2b0a75570d42c6500405e008f7f9a61836cf2a39190a45050565b61181a8133611cee565b50565b611827828261172a565b610306576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561185d3390565b6001600160a01b0316816001600160a01b0316837f3a8c19c5eddb5ca7fdd091f00e2b3978b86344c928af4d2d7f6733572cc06b4c60405160405180910390a45050565b600082828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052506040805180820190915260018152601d60f91b602082015294955092506118ff9150849050611c29565b9050600061190c83611c29565b90506119188282611d53565b60021461195d57604051636381e58960e11b81526020600482015260126024820152711a5b9d985b1a5908189a5908199bdc9b585d60721b60448201526064016102f3565b600061197161196c8484611df4565b611e13565b90507f555d5698c42247cb036edc5b97fe6d8220539f9241c57111ab85a0b439153151816040516020016119a591906128d9565b60405160208183030381529060405280519060200120146119fe57604051636381e58960e11b81526020600482015260126024820152711a5b9d985b1a5908189a5908199bdc9b585d60721b60448201526064016102f3565b6000611a0d61196c8585611df4565b90506000611a1e61196c8686611df4565b90507f3beeecf9b5ed23af30f944b146f760bff460619d18a81b711ecb099c02069d9082604051602001611a5291906128d9565b604051602081830303815290604052805190602001201415611b185780604051602001611a7f91906128d9565b60405160208183030381529060405280519060200120611aaf611a9f3390565b6001600160a01b03166014611e7c565b604051602001611abf91906128d9565b6040516020818303038152906040528051906020012014611b1857604051636381e58960e11b81526020600482015260126024820152710e0eac4d8d2c696caf240dad2e6dac2e8c6d60731b60448201526064016102f3565b505050505050505050565b606081611b475750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611b715780611b5b8161290b565b9150611b6a9050600a8361293c565b9150611b4b565b60008167ffffffffffffffff811115611b8c57611b8c612950565b6040519080825280601f01601f191660200182016040528015611bb6576020820181803683370190505b5090505b8415611c2157611bcb600183612966565b9150611bd8600a8661297d565b611be3906030612991565b60f81b818381518110611bf857611bf86129a9565b60200101906001600160f81b031916908160001a905350611c1a600a8661293c565b9450611bba565b949350505050565b60408051808201825260008082526020918201528151808301909252825182529182019181019190915290565b80518251606091600091611c6a9190612991565b67ffffffffffffffff811115611c8257611c82612950565b6040519080825280601f01601f191660200182016040528015611cac576020820181803683370190505b5090506000602082019050611cca8186602001518760000151612020565b8451611ce690611cda9083612991565b60208601518651612020565b509392505050565b611cf8828261172a565b61030657611d10816001600160a01b03166014611e7c565b611d1b836020611e7c565b604051602001611d2c9291906129bf565b60408051601f1981840301815290829052636381e58960e11b82526102f391600401612a34565b6000808260000151611d77856000015186602001518660000151876020015161209a565b611d819190612991565b90505b83516020850151611d959190612991565b8111611ded5781611da58161290b565b9250508260000151611ddc856020015183611dc09190612966565b8651611dcc9190612966565b838660000151876020015161209a565b611de69190612991565b9050611d84565b5092915050565b6040805180820190915260008082526020820152611ded8383836121bb565b60606000826000015167ffffffffffffffff811115611e3457611e34612950565b6040519080825280601f01601f191660200182016040528015611e5e576020820181803683370190505b5090506000602082019050611ded8185602001518660000151612020565b60606000611e8b836002612a47565b611e96906002612991565b67ffffffffffffffff811115611eae57611eae612950565b6040519080825280601f01601f191660200182016040528015611ed8576020820181803683370190505b509050600360fc1b81600081518110611ef357611ef36129a9565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611f2257611f226129a9565b60200101906001","600160f81b031916908160001a9053506000611f46846002612a47565b611f51906001612991565b90505b6001811115611fc9576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611f8557611f856129a9565b1a60f81b828281518110611f9b57611f9b6129a9565b60200101906001600160f81b031916908160001a90535060049490941c93611fc281612a66565b9050611f54565b50831561201957604051636381e58960e11b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016102f3565b9392505050565b602081106120585781518352612037602084612991565b9250612044602083612991565b9150612051602082612966565b9050612020565b600019811561208757600161206e836020612966565b61207a90610100612b61565b6120849190612966565b90505b9151835183169219169190911790915250565b600083818685116121a6576020851161215457600085156120e65760016120c2876020612966565b6120cd906008612a47565b6120d8906002612b61565b6120e29190612966565b1990505b845181166000876120f78b8b612991565b6121019190612966565b855190915083165b8281146121465781861061212e576121218b8b612991565b9650505050505050611c21565b856121388161290b565b965050838651169050612109565b859650505050505050611c21565b508383206000905b6121668689612966565b82116121a457858320818114156121835783945050505050611c21565b61218e600185612991565b935050818061219c9061290b565b92505061215c565b505b6121b08787612991565b979650505050505050565b604080518082019091526000808252602082015260006121ed856000015186602001518660000151876020015161209a565b6020808701805191860191909152519091506122099082612966565b83528451602086015161221c9190612991565b81141561222c576000855261225e565b8351835161223a9190612991565b85518690612249908390612966565b90525083516122589082612991565b60208601525b50909392505050565b82805461227390612872565b90600052602060002090601f01602090048101928261229557600085556122db565b82601f106122ae57805160ff19168380011785556122db565b828001600101855582156122db579182015b828111156122db5782518255916020019190600101906122c0565b506122e792915061235f565b5090565b8280546122f790612872565b90600052602060002090601f01602090048101928261231957600085556122db565b82601f106123325782800160ff198235161785556122db565b828001600101855582156122db579182015b828111156122db578235825591602001919060010190612344565b5b808211156122e75760008155600101612360565b6000806040838503121561238757600080fd5b8235915060208301356001600160a01b03811681146123a557600080fd5b809150509250929050565b60008083601f8401126123c257600080fd5b50813567ffffffffffffffff8111156123da57600080fd5b6020830191508360208285010111156123f257600080fd5b9250929050565b6000806020838503121561240c57600080fd5b823567ffffffffffffffff81111561242357600080fd5b61242f858286016123b0565b90969095509350505050565b63b95aa35560e01b600052602160045260246000fd5b60005b8381101561246c578181015183820152602001612454565b8381111561247b576000848401525b50505050565b60008151808452612499816020860160208601612451565b601f01601f19169290920160200192915050565b600061012060028c106124d05763b95aa35560e01b600052602160045260246000fd5b8b83528060208401526124e58184018c612481565b905082810360408401526124f9818b612481565b6001600160a01b038a1660608501529050828103608084015261251c8189612481565b905082810360a08401526125308188612481565b9150508460c083015261254760e083018515159052565b826101008301529a9950505050505050505050565b60008060008060008060006080888a03121561257757600080fd5b873567ffffffffffffffff8082111561258f57600080fd5b61259b8b838c016123b0565b909950975060208a01359150808211156125b457600080fd5b6125c08b838c016123b0565b909750955060408a01359150808211156125d957600080fd5b506125e68a828b016123b0565b9094509250506060880135600281106125fe57600080fd5b8091505092959891949750929550565b60008060006040848603121561262357600080fd5b833567ffffffffffffffff81111561263a57600080fd5b612646868287016123b0565b909790965060209590950135949350505050565b8481526080602082015260006126736080830186612481565b82810360408401526126858186612481565b91505060018060a01b038316606083015295945050505050565b6000806000806000606086880312156126b757600080fd5b853567ffffffffffffffff808211156126cf57600080fd5b6126db89838a016123b0565b90975095506020880135945060408801359150808211156126fb57600080fd5b50612708888289016123b0565b969995985093965092949392505050565b6000806000806040858703121561272f57600080fd5b843567ffffffffffffffff8082111561274757600080fd5b612753888389016123b0565b9096509450602087013591508082111561276c57600080fd5b50612779878288016123b0565b95989497509550505050565b6000806000806000806060878903121561279e57600080fd5b863567ffffffffffffffff808211156127b657600080fd5b6127c28a838b016123b0565b909850965060208901359150808211156127db57600080fd5b6127e78a838b016123b0565b9096509450604089013591508082111561280057600080fd5b5061280d89828a016123b0565b979a9699509497509295939492505050565b60006020828403121561283157600080fd5b81356001600160e01b03198116811461201957600080fd5b60006020828403121561285b57600080fd5b5035919050565b8183823760009101908152919050565b600181811c9082168061288657607f821691505b602082108114156128a75763b95aa35560e01b600052602260045260246000fd5b50919050565b602080825260129082015271189a59081b9bdd081c9959da5cdd195c995960721b604082015260600190565b600082516128eb818460208701612451565b9190910192915050565b63b95aa35560e01b600052601160045260246000fd5b600060001982141561291f5761291f6128f5565b5060010190565b63b95aa35560e01b600052601260045260246000fd5b60008261294b5761294b612926565b500490565b63b95aa35560e01b600052604160045260246000fd5b600082821015612978576129786128f5565b500390565b60008261298c5761298c612926565b500690565b600082198211156129a4576129a46128f5565b500190565b63b95aa35560e01b600052603260045260246000fd5b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516129f7816017850160208801612451565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612a28816028840160208801612451565b01602801949350505050565b6020815260006120196020830184612481565b6000816000190483118215151615612a6157612a616128f5565b500290565b600081612a7557612a756128f5565b506000190190565b600181815b80851115612ab8578160001904821115612a9e57612a9e6128f5565b80851615612aab57918102915b93841c9390800290612a82565b509250929050565b600082612acf5750600161174f565b81612adc5750600061174f565b8160018114612af25760028114612afc57612b18565b600191505061174f565b60ff841115612b0d57612b0d6128f5565b50506001821b61174f565b5060208310610133831016604e8410600b8410161715612b3b575081810a61174f565b612b458383612a7d565b8060001904821115612b5957612b596128f5565b029392505050565b60006120198383612ac056fee31a10a5ffe1c617f783aa198818c2e10aecf0245327a56fcdcd3fced90af0f3a2646970667358221220d4ee0f87ea44202bb08e9eb974a90a157f53b504c3adcd58d972e888f5536d2164736f6c634300080b0033"};

    public static final String SM_BINARY = org.fisco.bcos.sdk.v3.utils.StringUtils.joinAll("", SM_BINARY_ARRAY);

    public static final String[] ABI_ARRAY = {"[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"string\",\"name\":\"bid\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"validity\",\"type\":\"uint256\"}],\"name\":\"BidCertificated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"string\",\"name\":\"bid\",\"type\":\"string\"}],\"name\":\"BidCertificationRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"string\",\"name\":\"bid\",\"type\":\"string\"}],\"name\":\"BidCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"string\",\"name\":\"bid\",\"type\":\"string\"}],\"name\":\"IdpCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"string\",\"name\":\"bid\",\"type\":\"string\"}],\"name\":\"IdpGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"string\",\"name\":\"bid\",\"type\":\"string\"}],\"name\":\"IdpRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"conflictFields\":[{\"kind\":5}],\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"selector\":[2719481311,456278200],\"stateMutability\":\"view\",\"type\":\"function\"},{\"conflictFields\":[{\"kind\":5}],\"inputs\":[],\"name\":\"IDP_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"selector\":[752571089,1126108804],\"stateMutability\":\"view\",\"type\":\"function\"},{\"conflictFields\":[{\"kind\":0},{\"kind\":2,\"slot\":0,\"value\":[0]},{\"kind\":3,\"slot\":1,\"value\":[0]}],\"inputs\":[{\"internalType\":\"string\",\"name\":\"bid\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"validity\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"comment\",\"type\":\"string\"}],\"name\":\"certificateBid\",\"outputs\":[],\"selector\":[4053291403,2504421547],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"conflictFields\":[{\"kind\":3,\"slot\":0,\"value\":[0]}],\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"selector\":[613063843,4224970943],\"stateMutability\":\"view\",\"type\":\"function\"},{\"conflictFields\":[{\"kind\":0},{\"kind\":2,\"slot\":0,\"value\":[0]},{\"kind\":3,\"slot\":1,\"value\":[0]}],\"inputs\":[{\"internalType\":\"string\",\"name\":\"bid\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"idpType\",\"type\":\"uint256\"}],\"name\":\"grantIdpRole\",\"outputs\":[],\"selector\":[1767313836,2423853967],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"conflictFields\":[{\"kind\":0},{\"kind\":3,\"slot\":0,\"value\":[0]}],\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"selector\":[791671133,1416757515],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"conflictFields\":[{\"kind\":3,\"slot\":0,\"value\":[0]}],\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"selector\":[2446411860,3734140252],\"stateMutability\":\"view\",\"type\":\"function\"},{\"conflictFields\":[{\"kind\":0},{\"kind\":3,\"slot\":1,\"value\":[0]}],\"inputs\":[{\"internalType\":\"string\",\"name\":\"bid\",\"type\":\"string\"}],\"name\":\"queryBid\",\"outputs\":[{\"internalType\":\"enum Bid.IdentityType\",\"name\":\"userType\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"socialCode\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"publicKey\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"idpBid\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"comment\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"validity\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"verified\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"verifiedAt\",\"type\":\"uint256\"}],\"selector\":[3803900464,922780653],\"stateMutability\":\"view\",\"type\":\"function\"},{\"conflictFields\":[{\"kind\":0},{\"kind\":3,\"slot\":1,\"value\":[0]},{\"kind\":4,\"slot\":0,\"value\":[29,190,220,112,28,202,248,128,169,134,200,121,62,99,137,63,135,2,226,42,105,239,71,86,228,243,61,44,237,223,70,193]}],\"inputs\":[{\"internalType\":\"string\",\"name\":\"bid\",\"type\":\"string\"}],\"name\":\"queryIdp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"idpType\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"usci\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"publicKey\",\"type\":\"address\"}],\"selector\":[2857919592,2449766830],\"stateMutability\":\"view\",\"type\":\"function\"},{\"conflictFields\":[{\"kind\":0},{\"kind\":2,\"slot\":2,\"value\":[0]},{\"kind\":2,\"slot\":4,\"value\":[0]}],\"inputs\":[{\"internalType\":\"string\",\"name\":\"bid\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"socialCode\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"enum Bid.IdentityType\",\"name\":\"userType\",\"type\":\"uint8\"}],\"name\":\"registerBid\",\"outputs\":[],\"selector\":[3084052470,1762826557],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"conflictFields\":[{\"kind\":5}],\"inputs\":[{\"internalType\":\"string\",\"name\":\"bid\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"usci\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"registerIdp\",\"outputs\":[],\"selector\":[1891731402,3676972699],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"conflictFields\":[{\"kind\":0},{\"kind\":3,\"slot\":0,\"value\":[0]}],\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"selector\":[911641278,399928776],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"conflictFields\":[{\"kind\":0},{\"kind\":2,\"slot\":0,\"value\":[0]},{\"kind\":3,\"slot\":1,\"value\":[0]}],\"inputs\":[{\"internalType\":\"string\",\"name\":\"bid\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"comment\",\"type\":\"string\"}],\"name\":\"revokeBidCertification\",\"outputs\":[],\"selector\":[3031183232,2568169267],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"conflictFields\":[{\"kind\":0},{\"kind\":2,\"slot\":0,\"value\":[0]},{\"kind\":3,\"slot\":1,\"value\":[0]}],\"inputs\":[{\"internalType\":\"string\",\"name\":\"bid\",\"type\":\"string\"}],\"name\":\"revokeIdpRole\",\"outputs\":[],\"selector\":[1222831514,1251847683],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"conflictFields\":[{\"kind\":3,\"slot\":0,\"value\":[0]}],\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"selector\":[3578229791,4245284822],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"conflictFields\":[{\"kind\":5}],\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"selector\":[33540519,3934173080],\"stateMutability\":\"view\",\"type\":\"function\"}]"};

    public static final String ABI = org.fisco.bcos.sdk.v3.utils.StringUtils.joinAll("", ABI_ARRAY);

    public static final String FUNC_CERTIFICATEBID = "certificateBid";

    public static final String FUNC_GRANTIDPROLE = "grantIdpRole";

    public static final String FUNC_QUERYBID = "queryBid";

    public static final String FUNC_QUERYIDP = "queryIdp";

    public static final String FUNC_REGISTERBID = "registerBid";

    public static final String FUNC_REGISTERIDP = "registerIdp";

    public static final String FUNC_REVOKEBIDCERTIFICATION = "revokeBidCertification";

    public static final String FUNC_REVOKEIDPROLE = "revokeIdpRole";

    public static final Event BIDCERTIFICATED_EVENT = new Event("BidCertificated",
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Utf8String>(true) {}, new TypeReference<Uint256>() {}));
    ;

    public static final Event BIDCERTIFICATIONREVOKED_EVENT = new Event("BidCertificationRevoked",
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Utf8String>(true) {}));
    ;

    public static final Event BIDCREATED_EVENT = new Event("BidCreated",
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Utf8String>(true) {}));
    ;

    public static final Event IDPCREATED_EVENT = new Event("IdpCreated",
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Utf8String>(true) {}));
    ;

    public static final Event IDPGRANTED_EVENT = new Event("IdpGranted",
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Utf8String>(true) {}));
    ;

    public static final Event IDPREVOKED_EVENT = new Event("IdpRevoked",
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Utf8String>(true) {}));
    ;

    public static final BigInteger USER_TYPE_PERSONAL = new BigInteger("0");
    public static final BigInteger USER_TYPE_BUSINESS = new BigInteger("1");

    protected BTSIBID(String contractAddress, Client client, CryptoKeyPair credential) {
        super(getBinary(client.getCryptoSuite()), contractAddress, client, credential);
    }

    public static String getBinary(CryptoSuite cryptoSuite) {
        return (cryptoSuite.getCryptoTypeConfig() == CryptoType.ECDSA_TYPE ? BINARY : SM_BINARY);
    }

    public static String getABI() {
        return ABI;
    }

    public List<BidCertificatedEventResponse> getBidCertificatedEvents(
            TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList = extractEventParametersWithLog(BIDCERTIFICATED_EVENT, transactionReceipt);
        ArrayList<BidCertificatedEventResponse> responses = new ArrayList<BidCertificatedEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            BidCertificatedEventResponse typedResponse = new BidCertificatedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.addr = (String) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.bid = (byte[]) eventValues.getIndexedValues().get(1).getValue();
            typedResponse.validity = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public List<BidCertificationRevokedEventResponse> getBidCertificationRevokedEvents(
            TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList = extractEventParametersWithLog(BIDCERTIFICATIONREVOKED_EVENT, transactionReceipt);
        ArrayList<BidCertificationRevokedEventResponse> responses = new ArrayList<BidCertificationRevokedEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            BidCertificationRevokedEventResponse typedResponse = new BidCertificationRevokedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.addr = (String) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.bid = (byte[]) eventValues.getIndexedValues().get(1).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public List<BidCreatedEventResponse> getBidCreatedEvents(
            TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList = extractEventParametersWithLog(BIDCREATED_EVENT, transactionReceipt);
        ArrayList<BidCreatedEventResponse> responses = new ArrayList<BidCreatedEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            BidCreatedEventResponse typedResponse = new BidCreatedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.addr = (String) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.bid = (byte[]) eventValues.getIndexedValues().get(1).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public List<IdpCreatedEventResponse> getIdpCreatedEvents(
            TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList = extractEventParametersWithLog(IDPCREATED_EVENT, transactionReceipt);
        ArrayList<IdpCreatedEventResponse> responses = new ArrayList<IdpCreatedEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            IdpCreatedEventResponse typedResponse = new IdpCreatedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.addr = (String) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.bid = (byte[]) eventValues.getIndexedValues().get(1).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public List<IdpGrantedEventResponse> getIdpGrantedEvents(
            TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList = extractEventParametersWithLog(IDPGRANTED_EVENT, transactionReceipt);
        ArrayList<IdpGrantedEventResponse> responses = new ArrayList<IdpGrantedEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            IdpGrantedEventResponse typedResponse = new IdpGrantedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.addr = (String) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.bid = (byte[]) eventValues.getIndexedValues().get(1).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public List<IdpRevokedEventResponse> getIdpRevokedEvents(
            TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList = extractEventParametersWithLog(IDPREVOKED_EVENT, transactionReceipt);
        ArrayList<IdpRevokedEventResponse> responses = new ArrayList<IdpRevokedEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            IdpRevokedEventResponse typedResponse = new IdpRevokedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.addr = (String) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.bid = (byte[]) eventValues.getIndexedValues().get(1).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public TransactionReceipt certificateBid(String bid, BigInteger validity, String comment) {
        final Function function = new Function(
                FUNC_CERTIFICATEBID,
                Arrays.<Type>asList(new Utf8String(bid),
                new Uint256(validity),
                new Utf8String(comment)),
                Collections.<TypeReference<?>>emptyList(), 0);
        return executeTransaction(function);
    }

    public String getSignedTransactionForCertificateBid(String bid, BigInteger validity,
            String comment) {
        final Function function = new Function(
                FUNC_CERTIFICATEBID,
                Arrays.<Type>asList(new Utf8String(bid),
                new Uint256(validity),
                new Utf8String(comment)),
                Collections.<TypeReference<?>>emptyList(), 0);
        return createSignedTransaction(function);
    }

    public String certificateBid(String bid, BigInteger validity, String comment,
            TransactionCallback callback) {
        final Function function = new Function(
                FUNC_CERTIFICATEBID,
                Arrays.<Type>asList(new Utf8String(bid),
                new Uint256(validity),
                new Utf8String(comment)),
                Collections.<TypeReference<?>>emptyList(), 0);
        return asyncExecuteTransaction(function, callback);
    }

    public Tuple3<String, BigInteger, String> getCertificateBidInput(
            TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getInput().substring(10);
        final Function function = new Function(FUNC_CERTIFICATEBID,
                Arrays.<Type>asList(),
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}, new TypeReference<Uint256>() {}, new TypeReference<Utf8String>() {}));
        List<Type> results = this.functionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple3<String, BigInteger, String>(

                (String) results.get(0).getValue(),
                (BigInteger) results.get(1).getValue(),
                (String) results.get(2).getValue()
                );
    }

    public TransactionReceipt grantIdpRole(String bid, BigInteger idpType) {
        final Function function = new Function(
                FUNC_GRANTIDPROLE,
                Arrays.<Type>asList(new Utf8String(bid),
                new Uint256(idpType)),
                Collections.<TypeReference<?>>emptyList(), 0);
        return executeTransaction(function);
    }

    public String getSignedTransactionForGrantIdpRole(String bid, BigInteger idpType) {
        final Function function = new Function(
                FUNC_GRANTIDPROLE,
                Arrays.<Type>asList(new Utf8String(bid),
                new Uint256(idpType)),
                Collections.<TypeReference<?>>emptyList(), 0);
        return createSignedTransaction(function);
    }

    public String grantIdpRole(String bid, BigInteger idpType, TransactionCallback callback) {
        final Function function = new Function(
                FUNC_GRANTIDPROLE,
                Arrays.<Type>asList(new Utf8String(bid),
                new Uint256(idpType)),
                Collections.<TypeReference<?>>emptyList(), 0);
        return asyncExecuteTransaction(function, callback);
    }

    public Tuple2<String, BigInteger> getGrantIdpRoleInput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getInput().substring(10);
        final Function function = new Function(FUNC_GRANTIDPROLE,
                Arrays.<Type>asList(),
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}, new TypeReference<Uint256>() {}));
        List<Type> results = this.functionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple2<String, BigInteger>(

                (String) results.get(0).getValue(),
                (BigInteger) results.get(1).getValue()
                );
    }

    public Tuple9<BigInteger, String, String, String, String, String, BigInteger, Boolean, BigInteger> queryBid(
            String bid) throws ContractException {
        final Function function = new Function(FUNC_QUERYBID,
                Arrays.<Type>asList(new Utf8String(bid)),
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint8>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Address>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Uint256>() {}, new TypeReference<Bool>() {}, new TypeReference<Uint256>() {}));
        List<Type> results = executeCallWithMultipleValueReturn(function);
        return new Tuple9<BigInteger, String, String, String, String, String, BigInteger, Boolean, BigInteger>(
                (BigInteger) results.get(0).getValue(),
                (String) results.get(1).getValue(),
                (String) results.get(2).getValue(),
                (String) results.get(3).getValue(),
                (String) results.get(4).getValue(),
                (String) results.get(5).getValue(),
                (BigInteger) results.get(6).getValue(),
                (Boolean) results.get(7).getValue(),
                (BigInteger) results.get(8).getValue());
    }

    public Tuple4<BigInteger, String, String, String> queryIdp(String bid) throws
            ContractException {
        final Function function = new Function(FUNC_QUERYIDP,
                Arrays.<Type>asList(new Utf8String(bid)),
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Address>() {}));
        List<Type> results = executeCallWithMultipleValueReturn(function);
        return new Tuple4<BigInteger, String, String, String>(
                (BigInteger) results.get(0).getValue(),
                (String) results.get(1).getValue(),
                (String) results.get(2).getValue(),
                (String) results.get(3).getValue());
    }

    public TransactionReceipt registerBid(String bid, String socialCode, String name,
            BigInteger userType) {

        if(userType.equals(USER_TYPE_PERSONAL)){
            socialCode = sha256(socialCode);
            name = sha256(name);
        }

        final Function function = new Function(
                FUNC_REGISTERBID,
                Arrays.<Type>asList(new Utf8String(bid),
                new Utf8String(name),
                new Utf8String(socialCode),
                new Uint8(userType)),
                Collections.<TypeReference<?>>emptyList(), 0);
        return executeTransaction(function);
    }

    public String getSignedTransactionForRegisterBid(String bid, String socialCode, String name,
            BigInteger userType) {
        final Function function = new Function(
                FUNC_REGISTERBID,
                Arrays.<Type>asList(new Utf8String(bid),
                new Utf8String(name),
                new Utf8String(socialCode),
                new Uint8(userType)),
                Collections.<TypeReference<?>>emptyList(), 0);
        return createSignedTransaction(function);
    }

    public String registerBid(String bid, String socialCode, String name, BigInteger userType,
            TransactionCallback callback) {
        final Function function = new Function(
                FUNC_REGISTERBID,
                Arrays.<Type>asList(new Utf8String(bid),
                new Utf8String(name),
                new Utf8String(socialCode),
                new Uint8(userType)),
                Collections.<TypeReference<?>>emptyList(), 0);
        return asyncExecuteTransaction(function, callback);
    }

    public Tuple4<String, String, String, BigInteger> getRegisterBidInput(
            TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getInput().substring(10);
        final Function function = new Function(FUNC_REGISTERBID,
                Arrays.<Type>asList(),
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Uint8>() {}));
        List<Type> results = this.functionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple4<String, String, String, BigInteger>(

                (String) results.get(0).getValue(),
                (String) results.get(1).getValue(),
                (String) results.get(2).getValue(),
                (BigInteger) results.get(3).getValue()
                );
    }

    public TransactionReceipt registerIdp(String bid, String usci, String name) {
        final Function function = new Function(
                FUNC_REGISTERIDP,
                Arrays.<Type>asList(new Utf8String(bid),
                new Utf8String(name),
                new Utf8String(usci)),
                Collections.<TypeReference<?>>emptyList(), 4);
        return executeTransaction(function);
    }

    public String getSignedTransactionForRegisterIdp(String bid, String usci, String name) {
        final Function function = new Function(
                FUNC_REGISTERIDP,
                Arrays.<Type>asList(new Utf8String(bid),
                new Utf8String(name),
                new Utf8String(usci)),
                Collections.<TypeReference<?>>emptyList(), 4);
        return createSignedTransaction(function);
    }

    public String registerIdp(String bid, String usci, String name, TransactionCallback callback) {
        final Function function = new Function(
                FUNC_REGISTERIDP,
                Arrays.<Type>asList(new Utf8String(bid),
                new Utf8String(name),
                new Utf8String(usci)),
                Collections.<TypeReference<?>>emptyList(), 4);
        return asyncExecuteTransaction(function, callback);
    }

    public Tuple3<String, String, String> getRegisterIdpInput(
            TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getInput().substring(10);
        final Function function = new Function(FUNC_REGISTERIDP,
                Arrays.<Type>asList(),
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}));
        List<Type> results = this.functionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple3<String, String, String>(

                (String) results.get(0).getValue(),
                (String) results.get(1).getValue(),
                (String) results.get(2).getValue()
                );
    }

    public TransactionReceipt revokeBidCertification(String bid, String comment) {
        final Function function = new Function(
                FUNC_REVOKEBIDCERTIFICATION,
                Arrays.<Type>asList(new Utf8String(bid),
                new Utf8String(comment)),
                Collections.<TypeReference<?>>emptyList(), 0);
        return executeTransaction(function);
    }

    public String getSignedTransactionForRevokeBidCertification(String bid, String comment) {
        final Function function = new Function(
                FUNC_REVOKEBIDCERTIFICATION,
                Arrays.<Type>asList(new Utf8String(bid),
                new Utf8String(comment)),
                Collections.<TypeReference<?>>emptyList(), 0);
        return createSignedTransaction(function);
    }

    public String revokeBidCertification(String bid, String comment, TransactionCallback callback) {
        final Function function = new Function(
                FUNC_REVOKEBIDCERTIFICATION,
                Arrays.<Type>asList(new Utf8String(bid),
                new Utf8String(comment)),
                Collections.<TypeReference<?>>emptyList(), 0);
        return asyncExecuteTransaction(function, callback);
    }

    public Tuple2<String, String> getRevokeBidCertificationInput(
            TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getInput().substring(10);
        final Function function = new Function(FUNC_REVOKEBIDCERTIFICATION,
                Arrays.<Type>asList(),
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}));
        List<Type> results = this.functionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple2<String, String>(

                (String) results.get(0).getValue(),
                (String) results.get(1).getValue()
                );
    }

    public TransactionReceipt revokeIdpRole(String bid) {
        final Function function = new Function(
                FUNC_REVOKEIDPROLE,
                Arrays.<Type>asList(new Utf8String(bid)),
                Collections.<TypeReference<?>>emptyList(), 0);
        return executeTransaction(function);
    }

    public String getSignedTransactionForRevokeIdpRole(String bid) {
        final Function function = new Function(
                FUNC_REVOKEIDPROLE,
                Arrays.<Type>asList(new Utf8String(bid)),
                Collections.<TypeReference<?>>emptyList(), 0);
        return createSignedTransaction(function);
    }

    public String revokeIdpRole(String bid, TransactionCallback callback) {
        final Function function = new Function(
                FUNC_REVOKEIDPROLE,
                Arrays.<Type>asList(new Utf8String(bid)),
                Collections.<TypeReference<?>>emptyList(), 0);
        return asyncExecuteTransaction(function, callback);
    }

    public Tuple1<String> getRevokeIdpRoleInput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getInput().substring(10);
        final Function function = new Function(FUNC_REVOKEIDPROLE,
                Arrays.<Type>asList(),
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}));
        List<Type> results = this.functionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple1<String>(

                (String) results.get(0).getValue()
                );
    }

    public static BTSIBID load(String contractAddress, Client client, CryptoKeyPair credential) {
        return new BTSIBID(contractAddress, client, credential);
    }

    public static BTSIBID deploy(Client client, CryptoKeyPair credential) throws ContractException {
        return deploy(BTSIBID.class, client, credential, getBinary(client.getCryptoSuite()), getABI(), null, null);
    }

    public static class BidCertificatedEventResponse {
        public TransactionReceipt.Logs log;

        public String addr;

        public byte[] bid;

        public BigInteger validity;
    }

    public static class BidCertificationRevokedEventResponse {
        public TransactionReceipt.Logs log;

        public String addr;

        public byte[] bid;
    }

    public static class BidCreatedEventResponse {
        public TransactionReceipt.Logs log;

        public String addr;

        public byte[] bid;
    }

    public static class IdpCreatedEventResponse {
        public TransactionReceipt.Logs log;

        public String addr;

        public byte[] bid;
    }

    public static class IdpGrantedEventResponse {
        public TransactionReceipt.Logs log;

        public String addr;

        public byte[] bid;
    }

    public static class IdpRevokedEventResponse {
        public TransactionReceipt.Logs log;

        public String addr;

        public byte[] bid;
    }

    public static String sha256(String text) {
        try {
            MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
            byte[] hash = messageDigest.digest(text.getBytes(StandardCharsets.UTF_8));

            return String.format("%064x", new BigInteger(1, hash));
        }
        catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
            return null;
        }
    }
}
